define(
			[
	        	'jquery',
	        	'bootstrap',
	        	'underscore', 
	        	'backbone', 
	        	'text!templates/common/leftmenu.html',
	        	'appvariables'
        	],
        	function($,_bootstrap, _, Backbone, leftmenuTemplate, myapp) {
				var LeftMenuView = Backbone.View.extend({
					el : $("#leftmenu"),
					initialize : function() {
						this.render();
					},
					render : function() {
						var compileTemplate = _.template(leftmenuTemplate, {menus : this.model.toJSON()});
						this.$el.prepend(compileTemplate);
						$('ul.main-menu li:not(.nav-header):first').addClass('active');
						return this;
					},
					events  : {
						'mouseenter ul.main-menu li:not(.nav-header)' : function(e){
							$(e.target).animate({'margin-left':'+=5'},300);
						},
						'mouseleave ul.main-menu li:not(.nav-header)' : function(e){
							$(e.target).animate({'margin-left':'-=5'},300);
						},
						'click ul.main-menu li:not(.nav-header) a' : function(e) {
							var link = $(e.target).closest('a.ajax-link').attr('href');
							$('ul.main-menu li:not(.nav-header).active').removeClass('active');
							$('ul.main-menu li:not(.nav-header)').has(e.target).addClass('active');
							this.clickCallback(link);
						}
					},
					clickCallback : function() {
						
					}
				});
				return LeftMenuView;
});